package com.sdc.service.impl;

import com.sdc.dao.UserMapper;
import com.sdc.model.User;
import com.sdc.model.UserExample;
import com.sdc.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public void save(User user) {
        userMapper.insertSelective(user);
    }

    @Override
    public List<User> listAll() {
        return userMapper.selectByExample(new UserExample());
    }
}
